package com.xiaoshuidi.cloud.module.iot.convert.face;

import com.xiaoshuidi.cloud.module.iot.controller.admin.face.vo.FaceDatabaseCreateReq;
import com.xiaoshuidi.cloud.module.iot.controller.admin.face.vo.FaceDatabaseEditReq;
import com.xiaoshuidi.cloud.module.iot.controller.admin.face.vo.FaceDatabasePageResp;
import com.xiaoshuidi.cloud.module.iot.controller.admin.face.vo.FaceDatabaseResp;
import com.xiaoshuidi.cloud.module.iot.controller.app.face.vo.AppFaceDatabaseCreateReq;
import com.xiaoshuidi.cloud.module.iot.controller.app.face.vo.AppFaceDatabaseEditReq;
import com.xiaoshuidi.cloud.module.iot.controller.app.face.vo.AppFaceDatabasePageResp;
import com.xiaoshuidi.cloud.module.iot.dal.pojo.TbFaceDatabase;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Author Feng
 * @date 2023/6/26
 */
@Mapper
public interface FaceDatabaseConvert {


    FaceDatabaseConvert INSTANCE = Mappers.getMapper(FaceDatabaseConvert.class);


    @Mapping(source = "validStartDate", target = "validStartDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "validEndDate", target = "validEndDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd")
    FaceDatabasePageResp convert(TbFaceDatabase bean);

    TbFaceDatabase convert(FaceDatabaseCreateReq bean);

    TbFaceDatabase convert(AppFaceDatabaseEditReq bean);

    TbFaceDatabase convert(AppFaceDatabaseCreateReq req);

    @Mapping(source = "validStartDate", target = "validStartDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "validEndDate", target = "validEndDate", dateFormat = "yyyy-MM-dd")
    FaceDatabaseResp convertToFaceDatabaseResp(TbFaceDatabase bean);

    @Mapping(source = "validStartDate", target = "validStartDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "validEndDate", target = "validEndDate", dateFormat = "yyyy-MM-dd")
    AppFaceDatabasePageResp convertToAppPageResp(TbFaceDatabase bean);


    TbFaceDatabase convert(FaceDatabaseEditReq bean);
}
